(:
  A procedure to number all items in a Display file
  It suppresses any previous numbering
:)
declare boundary-space strip;
import module namespace
    jj = "http://kumquat.emse.fr/utilitaires"
    at "jjutils.xq" ;
<display>{
let $t := $arguments[1]
let $d := doc($t)/display/item
for $e at $p in $d
return
  <item>{
    <info name="num">{ $p }</info>,
    (  let $inf := $e/info
       for $i in $inf
       return
         if ($i[name="num"]) then
             ()
         else
             $i
    )
  }</item>
}</display>
